package ${package!}.controller;

import ${package!}.entity.${table.name!};
import ${package!}.service.${table.name!}Service;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author $!author
 * @since $!time.currTime()
 */
@RestController
@RequestMapping("${table.name?uncap_first}")
public class ${table.name}Controller {
@Resource
private ${table.name}Service ${table.name?uncap_first}Service;
    /**
     * 根据id取得数据
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("/{id:\\d{1,10}}")
    public ${table.name} getById(@PathVariable Integer id) {
        return ${table.name?uncap_first}Service.getById(id);
    }
}